#ifndef VISITOR_NODE_TO_ITEM
#define VISITOR_NODE_TO_ITEM 1

#include <vector>
#include <string>

#include <osg/NodeVisitor>
#include <osgViewer/Viewer>
#include <ObjectInspectorItem.h>
#include <OsgClassDataSource/ObjectOsg.h>
class VisitorNodeToItem : public osg::NodeVisitor
{
public:
    VisitorNodeToItem();
	
    virtual ~VisitorNodeToItem();

	virtual void apply(osg::Node& node);
    //virtual void apply(osg::Geode& node);
	virtual void apply(osgViewer::Viewer& viewer);

    void setRootItem(QStandardItem* root_item);

    ObjectOsg* creatObjOsg(osg::Object* node_ptr);
//    ObjectInspectorItem* creatCopyItemFromNode(osg::Node* node_ptr);

    void setIfGenerateAppliedNodeItem(bool bool_value);

    int getGeodeCount();
    void clearGeodeCount();
protected:
    void handleCameraManipulator();
private:
    QStandardItem* m_rootItem;
    QStandardItem* m_currentItem;
    QStandardItem* m_previousItem;
    std::vector<QStandardItem*> m_previousItemList;
    bool m_ifGenerateAppliedNodeItem;//this value is used in the apply(osg::node) funcion
    int m_geodeCount;
};

#endif //!VISITOR_NODE_TO_ITEM
